<template>
	<view>
		<scroll-view scroll-y="true" :style="'height:'+scrollH+'px;'">
			<view class="flex flex-column mx-2">
				<block v-for="(msg,index) in msgs" :key="index">
					<w-im-msg @msgClick="msgClick" :msg="msg"></w-im-msg>
				</block>				
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import wImMsg from '@/components/wboot/w-im-msg.vue';
	import msgList from '@/common/data/msg_list.js';
	export default {
		components:{
			wImMsg
		},
		data() {
			return {
				scrollH: 500,
				msgs:msgList.data,
			}
		},
		onLoad() {
			uni.getSystemInfo({
				success: res => {
					this.scrollH = res.windowHeight;
				}
			})
		},
		methods: {
			msgClick(msg){
				console.log(msg)
				uni.navigateTo({
					url:"../../pages/chat/chat"
				})
			}
		}
	}
</script>

<style>

</style>
